import React from 'react';

import { TagSelect } from '@/components/one-ui';

import { SchemaManageAPI } from '../../type';
interface IPropsType {
  id?: string;
  value?: any;
  onChange?: any;
  opt: SchemaManageAPI.ISearchList;
  type: string;
}

export const SearchTagSelect: React.FC<IPropsType> = (props) => {
  return (
    <TagSelect onChange={props?.onChange} value={props?.value}>
      {props?.opt?.dataSource &&
        props?.opt?.dataSource?.map((item) => {
          return (
            <TagSelect.Option key={item?.value} value={item?.value}>
              {item?.name}
            </TagSelect.Option>
          );
        })}
    </TagSelect>
  );
};
